package com.teamin.service.labelService;

import com.teamin.entity.LabelEntity;
import com.teamin.entity.LabelTaskEntity;

import java.util.List;

/**
 * 标签相关的服务
 */
public interface LabelService {

    /**
     * 删除标签
     * @param labelId
     * @return
     */
    int deleteByPrimaryKey(Long circleId,Long labelId,Long controlUser);

    /**
     * 添加一个标签
     * @param record
     * @return
     */
    int addLabelToCircle(LabelEntity record,Long controlUserId);

    /**
     * 查询标签
     * @param labelId
     * @return
     */
    LabelEntity selectByPrimaryKey(Long labelId);

    /**
     * 圈子中是否存在此标签名的标签
     * @param circleId
     * @return
     */
    Boolean existCircleLabelName(Long circleId,String labelName);

    /**
     * 圈子中是否存在此标签名的标签
     * @param circleId
     * @return
     */
    Boolean existCircleLabel(Long circleId,Long labelId);

    /**
     * 查询圈子下的标签
     * @param circleId
     * @return
     */
    List<LabelEntity> selectByCircle(Long circleId, String labelNameFilter);

    /**
     * 更新标签
     * @return
     */
    int updateByPrimaryKeySelective(LabelEntity labelEntity,Long controlUser);


    int insertToTask(LabelTaskEntity labelTaskEntity, Long circleId ,Long controUser,String userFlag);

    int deleteTaskLabel(Long taskId, Long labelId,Long circleId, Long controlUser,String userFlag);

    Boolean existTaskLabel(Long taskId, Long labelId);
}
